package com.sunjy.springbootredis.Controller;

import com.sunjy.springbootredis.redis.BaseRedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by sunjy on 2018/9/21.
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private BaseRedisService redis;

    @RequestMapping(value = "/test1", method = RequestMethod.GET)
    public void test1() throws Exception {
        for(int i=400;i<500;i++){
            redis.set("key"+i,"value"+i,100L);
        }
        for(int i=400;i<500;i++){
            System.out.println(redis.getString("key"+i));
        }
    }

}
